﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Web;
using VirtualPress.Infrastructure.Entities.Cache;
using VirtualPress.Portal.Biz;
using VirtualPress.Tool.Framework;

namespace VirtualPress.Portal.WebLogic
{
    public static class DynamicHTML
    {
        public static IHtmlString RenderWorkSpaceNav(this HtmlHelper<dynamic> html)
        {
            if (!HttpContext.Current.User.Identity.IsAuthenticated)
            {
                return new HtmlString(string.Empty);
            }
            var user = new UserCache().GetItem(HttpContext.Current.User.Identity.Name);
            if (user == null)
            {
                return new HtmlString(string.Empty);
            }

            StringBuilder sb = BuildNavHTML(user.SystemRole);
            return new HtmlString(sb.ToString());
        }

        private static StringBuilder BuildNavHTML(Infrastructure.Entities.Enum.UserRole userRole)
        {
            switch (userRole)
            {
                case Infrastructure.Entities.Enum.UserRole.Admin:
                    string journal = HttpContext.Current.Request.QueryString["journal"];
                    if (!String.IsNullOrEmpty(journal))
                    {
                        return BuildJournalAdminNavHTML();
                    }
                    return BuildAdminNavHTML();
                case Infrastructure.Entities.Enum.UserRole.Expert:
                    return BuildExpertNavHTML();
                case Infrastructure.Entities.Enum.UserRole.JounalsAdmin:
                    return BuildJournalAdminNavHTML();
                case Infrastructure.Entities.Enum.UserRole.MagazineAdmin:
                    return BuildMagazineAdminNavHTML();
                case Infrastructure.Entities.Enum.UserRole.ConferenceAdmin:
                    return BuildMeetingAdminNavHTML();
                default:
                case Infrastructure.Entities.Enum.UserRole.Member:
                    return BuildMemberNavHTML();
            }
        }
        //管理员左侧菜单
        private static StringBuilder adminNavHTML;
        private static StringBuilder BuildAdminNavHTML()
        {
            if (adminNavHTML == null)
            {
                adminNavHTML = new StringBuilder();
                adminNavHTML.Append("<li id=\"likmain\"><a href=\"/workspace/Press/index\"><i class=\"icon icon-home\"></i><span>起始页</span></a></li>");
                adminNavHTML.Append("<li id=\"likarticle\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-tint\"></i><span>稿件中心</span></a>");
                adminNavHTML.Append("<ul>");
                adminNavHTML.Append("<li><a href=\"/workspace/Press/article?group=0\">最新稿件</a></li>");
                adminNavHTML.Append("<li><a href=\"/workspace/Press/article?group=1\">待分配稿件</a></li>");
                adminNavHTML.Append("<li><a href=\"/workspace/Press/article?group=2\">专审稿件</a></li>");
                adminNavHTML.Append("<li><a href=\"/workspace/Press/article?group=3\">终审稿件</a></li>");
                adminNavHTML.Append("<li><a href=\"/workspace/Press/article?group=4\">录用稿件</a></li>");
                adminNavHTML.Append("<li><a href=\"/workspace/Press/article?group=5\">拒绝稿件</a></li>");
                adminNavHTML.Append("<li><a href=\"/workspace/Press/article?group=6\">撤销稿件</a></li>");
                adminNavHTML.Append("<li><a href=\"/workspace/Press/article?group=9\">全部稿件</a></li>");
                adminNavHTML.Append("</ul>");
                adminNavHTML.Append("</li>");
                adminNavHTML.Append("<li id=\"likbook\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-book\"></i><span>图书管理</span></a>");
                adminNavHTML.Append("<ul><li><a href=\"/WorkSpace/Press/Books\">所有图书</a></li>");
                adminNavHTML.Append("<li><a href=\"/WorkSpace/Press/PublishApply\">出版申请</a></li>");
                adminNavHTML.Append("</ul></li>");
                adminNavHTML.Append("<li id=\"likjournal\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-th-list\"></i><span>期刊管理</span></a>");
                adminNavHTML.Append("<ul>");
                adminNavHTML.Append("<li><a href=\"/WorkSpace/Press/JournalManage\">期刊运营</a></li>");
                adminNavHTML.Append("<li><a href=\"/WorkSpace/Press/JournalReq\">创刊申请</a></li>");
                adminNavHTML.Append("</ul>");
                adminNavHTML.Append("</li>");
                adminNavHTML.Append("<li id=\"likmeeting\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-bullhorn\"></i><span>会议管理</span></a>");
                adminNavHTML.Append("<ul><li><a href=\"/WorkSpace/Press/MeetingsApply\">会议管理</a></li>");
                adminNavHTML.Append("</ul></li>");
                adminNavHTML.Append("<li id=\"liknews\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-globe\"></i><span>站点管理</span></a>");
                adminNavHTML.Append("<ul>");
                adminNavHTML.Append("<li><a href=\"/WorkSpace/Press/News\">新闻动态</a></li>");
                adminNavHTML.Append("<li><a href=\"#\">行业分类</a></li>");
                adminNavHTML.Append("</ul>");
                adminNavHTML.Append("</li>");
                adminNavHTML.Append("<li class=\"submenu\"><a href=\"#\"><i class=\"icon icon-inbox\"></i><span>缴费管理</span></a>");
                adminNavHTML.Append("<ul>");
                adminNavHTML.Append("<li><a href=\"#\">待缴费项</a></li>");
                adminNavHTML.Append("<li><a href=\"#\">缴费记录</a></li>");
                adminNavHTML.Append("</ul>");
                adminNavHTML.Append("</li>");
                adminNavHTML.Append("<li id=\"liaccounts\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-user\"></i><span>账户管理</span></a>");
                adminNavHTML.Append("<ul >");
                adminNavHTML.Append("<li><a href=\"/WorkSpace/Press/Authors\">注册账户</a></li>");
                adminNavHTML.Append("<li><a href=\"/WorkSpace/Press/EditorialBoards\">期刊编委</a></li>");
                adminNavHTML.Append("<li><a href=\"/WorkSpace/Press/Experts\">审稿专家</a></li>");
                adminNavHTML.Append("<li><a href=\"/WorkSpace/Press/Editors\">编辑部</a></li>");
                adminNavHTML.Append("</ul>");
                adminNavHTML.Append("</li>");
                adminNavHTML.Append("<li id=\"likSelf\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-wrench\"></i><span>系统设置</span></a>");
                adminNavHTML.Append("<ul>");
                adminNavHTML.Append("<li><a href=\"/workspace/home/secret\">修改密码</a></li>");
                adminNavHTML.Append("<li><a href=\"#\">基础信息</a></li>");
                adminNavHTML.Append("<li><a href=\"#\">系统邮件</a></li>");
                adminNavHTML.Append("<li><a href=\"#\">其他设置</a></li>");
                adminNavHTML.Append("</ul>");
                adminNavHTML.Append("</li>");
            }
            return adminNavHTML;
        }
        
        //审稿专家左侧菜单
        private static StringBuilder expertNavHTML;
        private static StringBuilder BuildExpertNavHTML()
        {
            if (expertNavHTML == null)
            {
                expertNavHTML = new StringBuilder();
                expertNavHTML.Append("<li id=\"likmain\"><a href=\"/workspace/Expert/index\"><i class=\"icon icon-home\"></i><span>起始页</span></a></li>");
                expertNavHTML.Append("<li class=\"submenu\"><a href=\"#\"><i class=\"icon icon-th-list\"></i><span>审稿中心</span></a>");
                expertNavHTML.Append("<ul>");
                expertNavHTML.Append("<li><a href=\"#\">待审稿件</a></li>");
                expertNavHTML.Append("<li><a href=\"#\">已审稿件</a></li>");
                expertNavHTML.Append("<li><a href=\"#\">作废稿件</a></li>");
                expertNavHTML.Append("</ul>");
                expertNavHTML.Append("</li>");
                expertNavHTML.Append("<li id=\"likSelf\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-user\"></i><span>个人中心</span></a>");
                expertNavHTML.Append("<ul>");
                expertNavHTML.Append("<li><a href=\"/workspace/home/userinfo\">个人资料</a></li>");
                expertNavHTML.Append("<li><a href=\"/workspace/home/secret\">修改密码</a></li>");
                expertNavHTML.Append("<li><a href=\"#\">数据统计</a></li>");
                expertNavHTML.Append("</ul>");
                expertNavHTML.Append("</li>");
            }
            return expertNavHTML;
        }
       
        //期刊管理员左侧菜单
        private static StringBuilder journalAdminNavHTML;
        private static StringBuilder BuildJournalAdminNavHTML()
        {
            string journal = HttpContext.Current.Request.QueryString["journal"];
            if (journal.ToInt32(-1) == -1)
            {
                journal = String.Empty;
            }
            if (journalAdminNavHTML == null)
            {
                journalAdminNavHTML = new StringBuilder();
                journalAdminNavHTML.Append("<li id=\"likmain\"><a href=\"/workspace/console/index\"><i class=\"icon icon-home\"></i><span>起始页</span></a></li>");
                journalAdminNavHTML.Append("<li id=\"likarticle\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-th-list\"></i><span>稿件中心</span></a>");
                journalAdminNavHTML.Append("<ul>");
                journalAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/console/article?group=0{0}\">最新稿件</a></li>", String.IsNullOrEmpty(journal) ? "" : "&journal=" + journal));
                journalAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/console/article?group=1{0}\">待处理稿件</a></li>", String.IsNullOrEmpty(journal) ? "" : "&journal=" + journal));
                journalAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/console/article?group=2{0}\">专审稿件</a></li>", String.IsNullOrEmpty(journal) ? "" : "&journal=" + journal));
                journalAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/console/article?group=3{0}\">终审稿件</a></li>", String.IsNullOrEmpty(journal) ? "" : "&journal=" + journal));
                journalAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/console/article?group=4{0}\">录用稿件</a></li>", String.IsNullOrEmpty(journal) ? "" : "&journal=" + journal));
                journalAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/console/article?group=5{0}\">拒绝稿件</a></li>", String.IsNullOrEmpty(journal) ? "" : "&journal=" + journal));
                journalAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/console/article?group=6{0}\">待缴费稿件</a></li>", String.IsNullOrEmpty(journal) ? "" : "&journal=" + journal));
                journalAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/console/article?group=9{0}\">全部稿件</a></li>", String.IsNullOrEmpty(journal) ? "" : "&journal=" + journal));
                journalAdminNavHTML.Append("</ul>");
                journalAdminNavHTML.Append("</li>");
                journalAdminNavHTML.Append("<li id=\"likpublish\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-tasks\"></i><span>稿件出版</span></a>");
                journalAdminNavHTML.Append("<ul>");
                journalAdminNavHTML.Append("<li><a href=\"/workspace/console/articlebank\">稿件库</a></li>");
                journalAdminNavHTML.Append("<li><a href=\"/workspace/console/publish\">期刊出版</a></li>");
                //journalAdminNavHTML.Append("<li><a href=\"/workspace/console/publishhistory\">历史期刊</a></li>");
                journalAdminNavHTML.Append("</ul>");
                journalAdminNavHTML.Append("</li>");
                journalAdminNavHTML.Append("<li id=\"likjournalmanage\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-inbox\"></i><span>期刊管理</span></a>");
                journalAdminNavHTML.Append("<ul>");
                journalAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/console/baseinfo{0}\">基础信息</a></li>", String.IsNullOrEmpty(journal) ? "" : "?journal=" + journal));
                journalAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/console/introduction{0}\">期刊介绍</a></li>", String.IsNullOrEmpty(journal) ? "" : "?journal=" + journal));
                journalAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/console/announcement{0}\">征稿启事</a></li>", String.IsNullOrEmpty(journal) ? "" : "?journal=" + journal));
                //journalAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/console/retrieval{0}\">期刊检索</a></li>", String.IsNullOrEmpty(journal) ? "" : "?journal=" + journal));
                journalAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/console/attention{0}\">作者须知</a></li>", String.IsNullOrEmpty(journal) ? "" : "?journal=" + journal));
                journalAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/console/settings{0}\">期刊设置</a></li>", String.IsNullOrEmpty(journal) ? "" : "?journal=" + journal));
                journalAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/console/links{0}\">相关链接</a></li>", String.IsNullOrEmpty(journal) ? "" : "?journal=" + journal));
                journalAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/console/news{0}\">新闻动态</a></li>", String.IsNullOrEmpty(journal) ? "" : "?journal=" + journal));
                journalAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/console/download{0}\">相关下载</a></li>", String.IsNullOrEmpty(journal) ? "" : "?journal=" + journal));
                journalAdminNavHTML.Append("</ul>");
                journalAdminNavHTML.Append("</li>");
                journalAdminNavHTML.Append("<li id=\"likorganization\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-user\"></i><span>人员管理</span></a>");
                journalAdminNavHTML.Append("<ul>");
                journalAdminNavHTML.Append("<li><a href=\"/workspace/console/author\">稿件作者</a></li>");
                journalAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/console/Counsellor{0}\">编委成员</a></li>", String.IsNullOrEmpty(journal) ? "" : "?journal=" + journal));
                //journalAdminNavHTML.Append("<li><a href=\"#\">审稿专家</a></li>");
                journalAdminNavHTML.Append("</ul>");
                journalAdminNavHTML.Append("</li>");
                journalAdminNavHTML.Append("<li id=\"likSelf\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-wrench\"></i><span>系统维护</span></a>");
                journalAdminNavHTML.Append("<ul>");
                journalAdminNavHTML.Append("<li><a href=\"/workspace/home/secret\">修改密码</a></li>");
                //journalAdminNavHTML.Append("<li><a href=\"#\">稿件统计</a></li>");
                journalAdminNavHTML.Append("</ul>");
                journalAdminNavHTML.Append("</li>");
            }
            return journalAdminNavHTML;
        }
        
        //会议管理员左侧菜单
        private static StringBuilder meetingAdminNavHTML;
        private static StringBuilder BuildMeetingAdminNavHTML()
        {

            string meeting = HttpContext.Current.Request.QueryString["meeting"];
            if (meeting.ToInt32(-1) == -1)
            {
                meeting = String.Empty;
            }
            if (meetingAdminNavHTML == null)
            {
                meetingAdminNavHTML = new StringBuilder();
                meetingAdminNavHTML.Append("<li id=\"likmain\"><a href=\"/workspace/meeting/index\"><i class=\"icon icon-home\"></i><span>起始页</span></a></li>");
                meetingAdminNavHTML.Append("<li id=\"likarticle\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-th-list\"></i><span>稿件中心</span></a>");
                meetingAdminNavHTML.Append("<ul>");
                meetingAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/meeting/article?group=0{0}\">最新稿件</a></li>", String.IsNullOrEmpty(meeting) ? "" : "&journal=" + meeting));
                meetingAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/meeting/article?group=1{0}\">待处理稿件</a></li>", String.IsNullOrEmpty(meeting) ? "" : "&journal=" + meeting));
                meetingAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/meeting/article?group=2{0}\">专审稿件</a></li>", String.IsNullOrEmpty(meeting) ? "" : "&journal=" + meeting));
                meetingAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/meeting/article?group=3{0}\">终审稿件</a></li>", String.IsNullOrEmpty(meeting) ? "" : "&journal=" + meeting));
                meetingAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/meeting/article?group=4{0}\">录用稿件</a></li>", String.IsNullOrEmpty(meeting) ? "" : "&journal=" + meeting));
                meetingAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/meeting/article?group=5{0}\">拒绝稿件</a></li>", String.IsNullOrEmpty(meeting) ? "" : "&journal=" + meeting));
                meetingAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/meeting/article?group=6{0}\">待缴费稿件</a></li>", String.IsNullOrEmpty(meeting) ? "" : "&journal=" + meeting));
                meetingAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/meeting/article?group=9{0}\">全部稿件</a></li>", String.IsNullOrEmpty(meeting) ? "" : "&journal=" + meeting));
                meetingAdminNavHTML.Append("</ul>");
                meetingAdminNavHTML.Append("</li>");
                meetingAdminNavHTML.Append("<li id=\"likpublish\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-tasks\"></i><span>会议举办</span></a>");
                meetingAdminNavHTML.Append("<ul>");
                meetingAdminNavHTML.Append("<li><a href=\"/workspace/meeting/articlebank\">稿件库</a></li>");
                meetingAdminNavHTML.Append("<li><a href=\"/workspace/meeting/catalog\">出版会议集</a></li>");
                meetingAdminNavHTML.Append("</ul>");
                meetingAdminNavHTML.Append("</li>");
                meetingAdminNavHTML.Append("<li id=\"likjournalmanage\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-inbox\"></i><span>会议管理</span></a>");
                meetingAdminNavHTML.Append("<ul>");
                meetingAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/meeting/baseinfo{0}\">基础信息</a></li>", String.IsNullOrEmpty(meeting) ? "" : "?meeting=" + meeting));
                meetingAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/meeting/introduction{0}\">会议介绍</a></li>", String.IsNullOrEmpty(meeting) ? "" : "?meeting=" + meeting));
                meetingAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/meeting/announcement{0}\">征稿启事</a></li>", String.IsNullOrEmpty(meeting) ? "" : "?meeting=" + meeting));
                meetingAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/meeting/attention{0}\">作者须知</a></li>", String.IsNullOrEmpty(meeting) ? "" : "?meeting=" + meeting));
                meetingAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/meeting/contactus{0}\">联系我们</a></li>", String.IsNullOrEmpty(meeting) ? "" : "?meeting=" + meeting));               
                meetingAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/meeting/settings{0}\">会议设置</a></li>", String.IsNullOrEmpty(meeting) ? "" : "?meeting=" + meeting));
                meetingAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/meeting/links{0}\">相关链接</a></li>", String.IsNullOrEmpty(meeting) ? "" : "?meeting=" + meeting));
                meetingAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/meeting/news{0}\">新闻动态</a></li>", String.IsNullOrEmpty(meeting) ? "" : "?meeting=" + meeting));
                meetingAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/meeting/pan{0}\">重要日程</a></li>", String.IsNullOrEmpty(meeting) ? "" : "?meeting=" + meeting));
                meetingAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/meeting/download{0}\">相关下载</a></li>", String.IsNullOrEmpty(meeting) ? "" : "?meeting=" + meeting));
                meetingAdminNavHTML.Append("</ul>");
                meetingAdminNavHTML.Append("</li>");
                meetingAdminNavHTML.Append("<li id=\"likorganization\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-user\"></i><span>人员管理</span></a>");
                meetingAdminNavHTML.Append("<ul>");
                meetingAdminNavHTML.Append("<li><a href=\"/workspace/meeting/author\">稿件作者</a></li>");
                meetingAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/meeting/Counsellor{0}\">编委成员</a></li>", String.IsNullOrEmpty(meeting) ? "" : "?journal=" + meeting));
                //meetingAdminNavHTML.Append("<li><a href=\"#\">审稿专家</a></li>");
                meetingAdminNavHTML.Append("</ul>");
                meetingAdminNavHTML.Append("</li>");
                meetingAdminNavHTML.Append("<li id=\"likSelf\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-wrench\"></i><span>系统维护</span></a>");
                meetingAdminNavHTML.Append("<ul>");
                meetingAdminNavHTML.Append("<li><a href=\"/workspace/home/secret\">修改密码</a></li>");
                //meetingAdminNavHTML.Append("<li><a href=\"#\">稿件统计</a></li>");
                meetingAdminNavHTML.Append("</ul>");
                meetingAdminNavHTML.Append("</li>");
            }
            return meetingAdminNavHTML;
        }

        //杂志管理员左侧菜单
        private static StringBuilder magazineAdminNavHTML;
        private static StringBuilder BuildMagazineAdminNavHTML()
        {
            string journal = HttpContext.Current.Request.QueryString["journal"];
            if (journal.ToInt32(-1) == -1)
            {
                journal = String.Empty;
            }
            if (magazineAdminNavHTML == null)
            {
                magazineAdminNavHTML = new StringBuilder();
                magazineAdminNavHTML.Append("<li id=\"likmain\"><a href=\"/workspace/magazine/index\"><i class=\"icon icon-home\"></i><span>起始页</span></a></li>");
                magazineAdminNavHTML.Append("<li id=\"likarticle\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-th-list\"></i><span>稿件中心</span></a>");
                magazineAdminNavHTML.Append("<ul>");
                magazineAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/magazine/article?group=0{0}\">最新稿件</a></li>", String.IsNullOrEmpty(journal) ? "" : "&journal=" + journal));
                magazineAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/magazine/article?group=1{0}\">编辑校对</a></li>", String.IsNullOrEmpty(journal) ? "" : "&journal=" + journal));
                magazineAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/magazine/article?group=2{0}\">录用稿件</a></li>", String.IsNullOrEmpty(journal) ? "" : "&journal=" + journal));
                magazineAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/magazine/article?group=9{0}\">全部稿件</a></li>", String.IsNullOrEmpty(journal) ? "" : "&journal=" + journal));
                magazineAdminNavHTML.Append("</ul>");
                magazineAdminNavHTML.Append("</li>");
                magazineAdminNavHTML.Append("<li id=\"likpublish\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-tasks\"></i><span>稿件出版</span></a>");
                magazineAdminNavHTML.Append("<ul>");
                magazineAdminNavHTML.Append("<li><a href=\"/workspace/magazine/publish\">期刊出版</a></li>");
                magazineAdminNavHTML.Append("<li><a href=\"#\">历史期刊</a></li>");
                magazineAdminNavHTML.Append("</ul>");
                magazineAdminNavHTML.Append("</li>");
                magazineAdminNavHTML.Append("<li id=\"likjournalmanage\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-inbox\"></i><span>杂志管理</span></a>");
                magazineAdminNavHTML.Append("<ul>");
                magazineAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/magazine/baseinfo{0}\">基础信息</a></li>", String.IsNullOrEmpty(journal) ? "" : "?journal=" + journal));
                magazineAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/magazine/introduction{0}\">期刊介绍</a></li>", String.IsNullOrEmpty(journal) ? "" : "?journal=" + journal));
                magazineAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/magazine/announcement{0}\">主办方简介</a></li>", String.IsNullOrEmpty(journal) ? "" : "?journal=" + journal));
                //magazineAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/magazine/retrieval{0}\">期刊检索</a></li>", String.IsNullOrEmpty(journal) ? "" : "?journal=" + journal));
                magazineAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/magazine/attention{0}\">编委会</a></li>", String.IsNullOrEmpty(journal) ? "" : "?journal=" + journal));
                //magazineAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/magazine/settings{0}\">期刊设置</a></li>", String.IsNullOrEmpty(journal) ? "" : "?journal=" + journal));
                magazineAdminNavHTML.Append(String.Format("<li><a href=\"/workspace/magazine/links{0}\">相关链接</a></li>", String.IsNullOrEmpty(journal) ? "" : "?journal=" + journal));
                magazineAdminNavHTML.Append("</ul>");
                magazineAdminNavHTML.Append("</li>");
                magazineAdminNavHTML.Append("<li id=\"likSelf\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-wrench\"></i><span>系统维护</span></a>");
                magazineAdminNavHTML.Append("<ul>");
                magazineAdminNavHTML.Append("<li><a href=\"/workspace/home/secret\">修改密码</a></li>");
                //magazineAdminNavHTML.Append("<li><a href=\"#\">稿件统计</a></li>");
                magazineAdminNavHTML.Append("</ul>");
                magazineAdminNavHTML.Append("</li>");
            }
            return magazineAdminNavHTML;
        }

        //普通作者左侧菜单
        private static StringBuilder memberNavHTML;
        private static StringBuilder BuildMemberNavHTML()
        {
            if (memberNavHTML == null)
            {
                memberNavHTML = new StringBuilder();
                memberNavHTML.Append("<li id=\"likmain\"><a href=\"/workspace/member/index\"><i class=\"icon icon-home\"></i><span>起始页</span></a></li>");
                memberNavHTML.Append("<li id=\"likcontribute\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-arrow-up\"></i><span>我要投稿</span></a>");
                memberNavHTML.Append("<ul>");
                memberNavHTML.Append("<li><a href=\"/workspace/member/choosejournal\">期刊投稿</a></li>");
                memberNavHTML.Append("<li><a href=\"/workspace/member/choosemeeting\">会议投稿</a></li>");
                memberNavHTML.Append("</ul>");
                memberNavHTML.Append("</li>");
                memberNavHTML.Append("<li id=\"likarticle\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-th-list\"></i><span>期刊稿件</span></a>");
                memberNavHTML.Append("<ul>");
                memberNavHTML.Append("<li><a href=\"/workspace/member/article?type=0\">初审稿件</a></li>");
                memberNavHTML.Append("<li><a href=\"/workspace/member/article?type=1\">专审稿件</a></li>");
                memberNavHTML.Append("<li><a href=\"/workspace/member/article?type=2\">终审稿件</a></li>");
                memberNavHTML.Append("<li><a href=\"/workspace/member/article?type=20\">录用稿件</a></li>");
                memberNavHTML.Append("<li><a href=\"/workspace/member/article?type=40\">出版稿件</a></li>");
                memberNavHTML.Append("<li><a href=\"/workspace/member/article?type=99\">拒绝稿件</a></li>");
                memberNavHTML.Append("<li><a href=\"/workspace/member/article?type=-1\">所有稿件</a></li>");
                memberNavHTML.Append("</ul>");
                memberNavHTML.Append("</li>");
                memberNavHTML.Append("<li id=\"likmtarticle\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-list-alt\"></i><span>会议稿件</span></a>");
                memberNavHTML.Append("<ul>");
                memberNavHTML.Append("<li><a href=\"/workspace/member/manuscript?type=0\">初审稿件</a></li>");
                memberNavHTML.Append("<li><a href=\"/workspace/member/manuscript?type=1\">专审稿件</a></li>");
                memberNavHTML.Append("<li><a href=\"/workspace/member/manuscript?type=2\">终审稿件</a></li>");
                memberNavHTML.Append("<li><a href=\"/workspace/member/manuscript?type=20\">录用稿件</a></li>");
                memberNavHTML.Append("<li><a href=\"/workspace/member/manuscript?type=99\">拒绝稿件</a></li>");
                memberNavHTML.Append("<li><a href=\"/workspace/member/manuscript?type=-1\">所有稿件</a></li>");
                memberNavHTML.Append("</ul>");
                memberNavHTML.Append("</li>");
                memberNavHTML.Append("<li id=\"likpayment\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-inbox\"></i><span>缴费管理</span></a>");
                memberNavHTML.Append("<ul>");
                memberNavHTML.Append("<li><a href=\"/workspace/member/bill\">缴费通知</a></li>");
                memberNavHTML.Append("<li><a href=\"/workspace/member/billlog\">缴费记录</a></li>");
                memberNavHTML.Append("</ul>");
                memberNavHTML.Append("</li>");
                memberNavHTML.Append("<li id=\"likSelf\" class=\"submenu\"><a href=\"#\"><i class=\"icon icon-user\"></i><span>个人中心</span></a>");
                memberNavHTML.Append("<ul>");
                memberNavHTML.Append("<li><a href=\"/workspace/member/author\">稿件作者</a></li>");
                memberNavHTML.Append("<li><a href=\"/workspace/member/myjournals\">我的期刊</a></li>");
                memberNavHTML.Append("<li><a href=\"/workspace/home/userinfo\">个人资料</a></li>");
                memberNavHTML.Append("<li><a href=\"/workspace/home/secret\">修改密码</a></li>");
                
                memberNavHTML.Append("</ul>");
                memberNavHTML.Append("</li>");
            }
            return memberNavHTML;
        }
    }
}
